UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kegWKRjZFGZET18YSTaj+YRdVaiY51g8SH8ljk2Tm1o='
WHERE
key_id = '86c9a6541364a546991f8daf817f46162f5550b4d9aeeda7080d60dc83eae477'
AND (
token = 'kegWKRjZFGZET18YSTaj+YRdVaiY51g8SH8ljk2Tm1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)