UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nxB2JNVGgimrIp8fleoevCZxqWufEwZI5z8u+T0TJCI=' 
WHERE 
  key_id = 'a2637b040a23ade181ca26998ef6c2045440bfa9e4d3babaec4eab82227ad279' 
  AND (
    token = 'nxB2JNVGgimrIp8fleoevCZxqWufEwZI5z8u+T0TJCI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056