UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dstKmr3+eQXuVr1dzDfLbXrshncLlR7Jna5KDgx1BPA='
WHERE
key_id = '7a1450d21881219c36f0e6ab57b7fcd25e2633f17136b3fb7b9ba6bd32d6727e'
AND (
token = 'dstKmr3+eQXuVr1dzDfLbXrshncLlR7Jna5KDgx1BPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)