UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HyF60GVGrk06ZdpybeP6ANmVUUmBgSD4axysJLWPBpE=' 
WHERE 
  key_id = 'fa759a81819fc3c5dc32204e08a594e58a5eed016067576ad7a894875893b1b0' 
  AND (
    token = 'HyF60GVGrk06ZdpybeP6ANmVUUmBgSD4axysJLWPBpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027