UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yiWse5rxVnOEywpRAxKkZOAsFWdq2gnJJA0XVJdsCrc='
WHERE
key_id = '1976d842df1fe89036db66d5fa371eead0c9211663ae46acaaee9c93774e1b95'
AND (
token = 'yiWse5rxVnOEywpRAxKkZOAsFWdq2gnJJA0XVJdsCrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)