UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7m9h80hxClupSjzZW2kYPPMVUu0qe/ZwcpKLVvX2HNg=' 
WHERE 
  key_id = '4d1a50836591c1d9c18868f74fe3d5f757b38e576d522bdb26865c8ed3b90a03' 
  AND (
    token = '7m9h80hxClupSjzZW2kYPPMVUu0qe/ZwcpKLVvX2HNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055