UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q4NM1V3uk9T8YV9V+kMp9K5z85+Lh6BRnMPuFD17Ckk=' 
WHERE 
  key_id = '5d0655489298b17be4d526007cd5e87f8d8ccacdf21ec28910c3084ac270844d' 
  AND (
    token = 'q4NM1V3uk9T8YV9V+kMp9K5z85+Lh6BRnMPuFD17Ckk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022