UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sAtwwWjl8Utn7MVL/zo5+c3isZANVqnsFuSr74C2F34='
WHERE
key_id = '94a942074c1ce998735f8a4e4c288521cff1e3b283dcb64b93709eda7d336c8c'
AND (
token = 'sAtwwWjl8Utn7MVL/zo5+c3isZANVqnsFuSr74C2F34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)