UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hXcItFXza1c3pF2wu1ux+v8wgmCN3YhXL2XRSPY3eQQ=' 
WHERE 
  key_id = '86e50ba44cdbc207d4984cd4ca3ce2ac41a27ee63a9a36e590f168c2daa4ca76' 
  AND (
    token = 'hXcItFXza1c3pF2wu1ux+v8wgmCN3YhXL2XRSPY3eQQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053