UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zp+sR2hj8xao4RSxAOyYIMX2RKVu0+QsuDnbz46OgDU='
WHERE
key_id = '3dc2163f3fcc449b1402b483c5bfe8b6e2cac45db558530016d0f190ede5c073'
AND (
token = 'Zp+sR2hj8xao4RSxAOyYIMX2RKVu0+QsuDnbz46OgDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)