UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '51XVF7+R7SPMViTeeUz5C+KVWzBojT7whZdb59k/J+s='
WHERE
key_id = '5425a9b99f1169fb34633b5bb351fbb0a0cd24a9d81ebf274b833d4a45e5c124'
AND (
token = '51XVF7+R7SPMViTeeUz5C+KVWzBojT7whZdb59k/J+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)