UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QEWQ8vSMZ3tKX8+t1yi+YkqV65LDHQqYAsSqLyQnyiA=' 
WHERE 
  key_id = '0c3f8cf9b29957d98dcdd7d95c7e8980eca793ba46ea936b66f473dcbacc2ecc' 
  AND (
    token = 'QEWQ8vSMZ3tKX8+t1yi+YkqV65LDHQqYAsSqLyQnyiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031