UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm292LILILR19d9zo0ph+B68K72HDfNJIHo9mtqoLkpA='
WHERE
key_id = 'ddfa6f916d2540b98ca3bf9dc8fca1fae76ae9118ae252cda6660549305c9e72'
AND (
token = 'm292LILILR19d9zo0ph+B68K72HDfNJIHo9mtqoLkpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)