UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8KySFUUoIenU8UsiQPoGJIS1Y1ZbNkrTiDFCLD6NPc='
WHERE
key_id = 'fc6215891aa104bf0d8835100817ff06d69a630ff80e689c3212ca1a55e64855'
AND (
token = 'F8KySFUUoIenU8UsiQPoGJIS1Y1ZbNkrTiDFCLD6NPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)