UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cnv6vyHazS8d2L9Ev5O6GtkP9iRnz4TQ9TOn4sRkurI=' 
WHERE 
  key_id = '56b03d8900f2db663e15e8dcb66152e306417179e63a39f110c61ef21b333350' 
  AND (
    token = 'Cnv6vyHazS8d2L9Ev5O6GtkP9iRnz4TQ9TOn4sRkurI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025