UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yBOjmJFftSZJg7P+mUu97uXsLfqKdLOqNQ+NheBDIlM='
WHERE
key_id = 'd239cddeae3709e130ef60b7cfd9a96ae39466e3d8b362c7364774d989d75469'
AND (
token = 'yBOjmJFftSZJg7P+mUu97uXsLfqKdLOqNQ+NheBDIlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)