UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g4gfZpuwu+ukTGlow4SUZwzaGwNc1IT5mqbIY6tbv4Q=' 
WHERE 
  key_id = '89eb042362125b1db6d21ce1610bea267469b4623faf0153dd7f5deed42621f3' 
  AND (
    token = 'g4gfZpuwu+ukTGlow4SUZwzaGwNc1IT5mqbIY6tbv4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027