UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EnGqBxzjPDk6/G3tU1gyzKmLRV4Trt3t5Ko0nObojYE=' 
WHERE 
  key_id = '6bc5c0791d7cb537c70b2a55b00927eb1072341b8389253e0c759bbe78fa8b71' 
  AND (
    token = 'EnGqBxzjPDk6/G3tU1gyzKmLRV4Trt3t5Ko0nObojYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044