UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IkapSg/XVMFKF5iuAwelt9bIvyMDC64zpaWkbUGXcwc=' 
WHERE 
  key_id = '474bd7d52564bed7f082c8e665439800d5827d215cbe992818a18ef00c94061d' 
  AND (
    token = 'IkapSg/XVMFKF5iuAwelt9bIvyMDC64zpaWkbUGXcwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031