UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v9FW+9nfGXLxd9aY5muIXa0fSzwysQoUE7Gs03Ul4Y4=' 
WHERE 
  key_id = '233c9865da803fc2cf277f3c59df1ed268c2bca48f5ca6bf0ba7247536fb8d62' 
  AND (
    token = 'v9FW+9nfGXLxd9aY5muIXa0fSzwysQoUE7Gs03Ul4Y4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034