UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DvgA6ko2AK1zEGQZnxVi2wxAMxFGqH+gS1Jkixkx+bs='
WHERE
key_id = '097a8db26055a656f42e361f84ff36a2debdab4dce685c3201a7fb9cebac97a6'
AND (
token = 'DvgA6ko2AK1zEGQZnxVi2wxAMxFGqH+gS1Jkixkx+bs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)