UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M3QOtHvjRYI+Z/VHoBi8mNTYG+VzWfvnK9RGbtHgVt0='
WHERE
key_id = '430ccc641b780a7f4c55358a43adae3f1d23d73302890810c3daaa5d4e709c52'
AND (
token = 'M3QOtHvjRYI+Z/VHoBi8mNTYG+VzWfvnK9RGbtHgVt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)