UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qinUfG4CPbSIo+WjfJhllpNLHdll2Nz2aCSPNY2heSg=' 
WHERE 
  key_id = '26508f854a9903922118e8525dab6d8d01e050b866133cb2b28eb7483357b6eb' 
  AND (
    token = 'qinUfG4CPbSIo+WjfJhllpNLHdll2Nz2aCSPNY2heSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021