UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I2KBE5NI6YnQDk6B/OT/4KhjRPXbo/UZAVLQcw4SMC4=' 
WHERE 
  key_id = 'fdb00094ca4372707c1c309fb80207b7c97af7e3babc5f7915148782fd37c1cf' 
  AND (
    token = 'I2KBE5NI6YnQDk6B/OT/4KhjRPXbo/UZAVLQcw4SMC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021