UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yP1vLgNp6qCBY/QDNNEwm6J8dZC1EHlHaZemss/k4LI='
WHERE
key_id = 'c7158a72508caf078e6898a4d6a5818c04c8a523a1f47f28db1ba8d28ad41b24'
AND (
token = 'yP1vLgNp6qCBY/QDNNEwm6J8dZC1EHlHaZemss/k4LI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)