UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0E2Pa06BiiHhKS/5wDVYWifUN7xUDp5VMwxXTcyRZvg=' 
WHERE 
  key_id = '4e4c0a6300f3296b9a44696a6e30b8656d79a1bd63f78883c3f1475f33f40b74' 
  AND (
    token = '0E2Pa06BiiHhKS/5wDVYWifUN7xUDp5VMwxXTcyRZvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022