UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hLshGTAxhPcp15ysEp/S7IkAik6bpkJTnJiS6yIvIZ8=' 
WHERE 
  key_id = '4a05856ffc073a937414ed2ba7988deef4e6ca7bbabd649897663255aa736127' 
  AND (
    token = 'hLshGTAxhPcp15ysEp/S7IkAik6bpkJTnJiS6yIvIZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043