UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ayZFo6QIMsuWBsjHJjzH33NLBTeN3M4Z6/YBV4bfG/o=' 
WHERE 
  key_id = '714fdf3bf7cf75cf0893a842e3a847ea9bf0dce09061bc30dd886f57c1a2f75c' 
  AND (
    token = 'ayZFo6QIMsuWBsjHJjzH33NLBTeN3M4Z6/YBV4bfG/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029