UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N6RbgtKRk/DJ6C+lMU7o8Yx/8B/cSsYwQ0mc42zdl30='
WHERE
key_id = '5009eacf1eb8ccaacae782eecb0e9e14cfadb08b31ca9b53ea36c154fd651528'
AND (
token = 'N6RbgtKRk/DJ6C+lMU7o8Yx/8B/cSsYwQ0mc42zdl30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)